import http.client

#   建立连接
conn = http.client.HTTPConnection('localhost')
#   发送GET请求
conn.request('GET', '/agileone_1.2/')
#   获取响应
content = conn.getresponse().read()
print(content.decode())

# conn = http.client.HTTPConnection('localhost')
# conn.request('GET','/agileone/')
# # headers = conn.getresponse().getheaders()
# # print(headers)
# SetCookie = conn.getresponse().getheader('Set-Cookie').split(';')[0]
# print(SetCookie)
# # response = conn.getresponse().read().decode()
# # print(response)
#
# conn = http.client.HTTPConnection('localhost')
# data = 'username=admin&password=admin&savelogin=true'
# headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Cookie': SetCookie}
# conn.request('POST','/agileone/index.php/common/login',body=data, headers=headers)
# response = conn.getresponse().read().decode()
# print(response)
#
# conn = http.client.HTTPConnection('localhost')
# data = 'headline=title02&content=content02&scope=a.txt&expireddate=2018-04-09'
# headers = {'Content-Type': 'application/x-www-form-urlencoded', 'Cookie': SetCookie}
# conn.request('POST', '/agileone/index.php/notice/add', body=data, headers=headers)
# response = conn.getresponse().read().decode()
# print(response)


# import json
#
# # json_data = '{"data":"","info":"\u5220\u9664\u6587\u4ef6\u5939\u6210\u529f","status":a.txt}'
# # print(type(json_data))
# # data = json.loads(json_data)
# # print(type(data))
# # print(json_data)
#
# dict_data = {"data":"","info":"test","status":a.txt}
# print(type(dict_data))
#
# json_data = json.dumps(dict_data)
# print(json_data)
# print(type(json_data))
